<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
 
require_once( JPATH_SITE . DS . 'components' . DS . 'com_content' . DS . 'helpers' . DS . 'route.php' );
jimport( 'joomla.application.component.view');
 
class NewsletterViewNewsletter extends JView
{

    function display($tpl = null)
    {
	global $mainframe;
	$document	=& JFactory::getDocument();
	$user		=& JFactory::getUser();
	$uri		=& JFactory::getURI();
	$params		=& $mainframe->getParams('com_newsletter');

	$newsletter = $this->getModel('newsletter');

	$params->set('catid',37);
	$grafica =& $newsletter->getList($params);

	$params->set('catid',31);
	$portales =& $newsletter->getList($params);

	$params->set('catid',14);
	$radios =& $newsletter->getList($params);

	$params->set('catid',19);
	$television =& $newsletter->getList($params);

	$params->set('catid',18);
	$agencias =& $newsletter->getList($params);

	$this->assign('grafica',	$grafica);
	$this->assign('portales', 	$portales);
	$this->assign('radios',		$radios);
	$this->assign('television',	$television);
	$this->assign('agencias',	$agencias);
    	$this->assign('action', 	$uri->toString()); 

	parent::display($tpl);

    }


    function preview($tpl = null)
    {
    	$uri		=& JFactory::getURI();
	
    	$this->assign('body',             $this->getModel('newsletter')->getBody());
    	$this->assign('action',           $uri->toString()); 
    	$this->assign('noticiaDelDia',    JRequest::getVar('noticiaDelDia'));
	$this->assign('articulosSeleccionados', JRequest::getVar('articulosSeleccionados'));
	
    	parent::display('generado');
    }
    
    function enviado($tpl = null)
    {
    	parent::display('enviado');
    
    }
}
